package com.boardgame.gwt.data.space;

import java.util.ArrayList;
import java.util.List;

/**
 * 建筑格子
 */
public class GwtSpaceBuilding extends GwtSpace{

    public final static int BUILDING_SIZE=3;

    public GwtSpaceBuilding(){
        this.setSize(BUILDING_SIZE);
        this.setBordercolor("black");
    }

    /**
     * 创建建筑格子
     * @return
     */
    public static List<GwtSpace> createSpaceBuilding(){
        List<GwtSpace> list = new ArrayList<>();
        //14行
        int[][] pos= {{
                0,0,1,1,1,1,2,3,4,4,4,5,7,8,8,9,10,10,11,11,12,13,13,14,14,14,7//行
        },{
                4,5,0,1,2,3,0,3,0,1,2,0,1,0,1,0,0 ,1 ,4 ,5 ,0 ,0 ,1 ,0 ,1 ,2 ,0//列
        },{
                0,0,0,0,0,0,4,0,0,0,0,4,0,0,0,4,0 ,0 ,0 ,0 ,4 ,0 ,3 ,0 ,0 ,0 ,0//偏移
        },{
                2,2,2,2,2,2,3,1,0,0,1,4,0,0,0,4,0 ,0 ,0 ,0 ,4 ,0 ,3 ,0 ,0 ,0 ,0//下一行代号
        }
        };
        for (int i=0;i<pos[0].length;i++){
            GwtSpaceBuilding gwtSpaceBuilding=new GwtSpaceBuilding();
            gwtSpaceBuilding.setRow(pos[0][i]);
            gwtSpaceBuilding.setColumn(pos[1][i]);
            gwtSpaceBuilding.setOffset(pos[2][i]);
            list.add(gwtSpaceBuilding);
        }

        return list;
    }
}